public class Animals {
    private Animal _items[];
    private int _count;
    private int _capacity;

    public Animals(int capacity) {
        _capacity = capacity;
        _items = new Animal[_capacity];
    }

    public void add(Animal animal) {
        if (_count >= _capacity)
            return;

        _items[_count] = animal;
        _count++;
    }

    public int count() {
        return _count;
    }
    
    public Animal get(int index) {
        if (index < 0 || index >= _count)
            return null;

        return _items[index];
    }
}
